package

        com.rightrule.controller;

import java.util.Arrays;
import java.util.Map;

import com.rightrule.entity.DecisionEventFieldMapEntity;
import com.rightrule.service.DecisionEventFieldMapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.rightrule.common.utils.PageUtils;
import com.rightrule.common.utils.R;


/**
 * 事件-变量关联表
 *
 * @author xiaowu
 * @email 980951938@qq.com
 * @date 2024-08-07 21:54:38
 */
@RestController
@RequestMapping("code/decisioneventfieldmap")
public class DecisionEventFieldMapController {
    @Autowired
    private DecisionEventFieldMapService decisionEventFieldMapService;

    /**
     * 列表
     */
    @RequestMapping("/list")
        public R list(@RequestParam Map<String, Object> params) {
        PageUtils page = decisionEventFieldMapService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
        public R info(@PathVariable("id") Long id) {
            DecisionEventFieldMapEntity decisionEventFieldMap = decisionEventFieldMapService.getById(id);

        return R.ok().put("decisionEventFieldMap", decisionEventFieldMap);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
        public R save(@RequestBody DecisionEventFieldMapEntity decisionEventFieldMap) {
            decisionEventFieldMapService.save(decisionEventFieldMap);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
        public R update(@RequestBody DecisionEventFieldMapEntity decisionEventFieldMap) {
            decisionEventFieldMapService.updateById(decisionEventFieldMap);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
        public R delete(@RequestBody Long[]ids) {
            decisionEventFieldMapService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
